#include "sinks/file_sink.hpp"
#include <iostream>

FileSink::FileSink(const std::string& filename, size_t max_size, size_t max_files, const std::string& sinkname) 
    : m_filename(filename)
    , m_sinkName(sinkname) {

    m_writer = std::make_unique<axon_logger::io::RotatingFileWriter>(filename, max_size, max_files);
}


FileSink::~FileSink() = default;


void FileSink::log(LogLevel level, const std::string& formatted_message) {
    if (m_writer) {
        m_writer->write(formatted_message);
    }
}



